var dialogManager = cc.Class({
    extends: cc.Component,
    statics: {
        showDialog(prefabUrl,mControl,args){
            cc.loader.loadRes(prefabUrl, function (err, prefab) {
                if (err) {
                    console.log(err);
                    return;
                }
                var newNode = cc.instantiate(prefab);
                cc.director.getScene().addChild(newNode,9999);
                if(mControl){
                    newNode.getComponent(mControl).show(args);
                    return newNode.getComponent(mControl);
                }    
            });
        },
        showCommonDialog(args){
            this.showDialog("prefab/commonNode",require("commonControl"),args); 
        },
        showSetDialog(){
            this.showDialog("prefab/setNode"); 
        },
        showHelpDialog(){
            this.showDialog("prefab/helpNode"); 
        },
        showRoleDialog(){
            this.showDialog("prefab/roleNode");
        },
        showPetDialog(){
            this.showDialog("prefab/petNode2");
        },
        showGameResultDialog(args){
            this.showDialog("prefab/resultNode",require("resultControl"),args);
        },
        showShiPinDialog(args){
            this.showDialog("prefab/shipinNode",require("kanshipinControl"),args);
        },
        showNotEnoughGoldDialog(){
            this.showDialog("prefab/notEnoughGoldNode");
        },
        showAuthorizeDialog(){
            this.showDialog("prefab/AuthorizeNode");
        },
        showRankDialog(){
            this.showDialog("prefab/RankListNode");
        },
        showLoadingDialog(){
            this.showDialog("prefab/loadingNode");
        }

    },
});
